home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1633 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.1 KB  |  47 lines

  1. Path: newsjunkie.ans.net!butch!news
  2. From: "William Z. Tang" <tangb@tccs2.ssd.lmsc.lockheed.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: gettimeofday call in C++
  5. Date: Thu, 11 Jan 1996 17:04:13 -0800
  6. Organization: 73-16
  7. Message-ID: <30F5B38D.1E8B@tccs2.ssd.lmsc.lockheed.com>
  8. NNTP-Posting-Host: woodall.ssd.lmsc.lockheed.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b2 (X11; I; SunOS 5.4 sun4m)
  13.  
  14. I am on a Solaris 2.4 machine running SUN's Visual Workshop for C++.
  15.  
  16. When I compiled the following codes (inside a large C++ program)
  17. with CC (C++ compiler), the compiler gives me :
  18. "test.c", line 11: Error: Too few arguments in call to
  19. gettimeofday(timeval*, void*).
  20.  
  21. But this code works fine with the regular C compiler. 
  22. Anybody know what's the deal??
  23.  
  24.  
  25. #include <sys/time.h>
  26. #include <stdio.h>
  27. #include <time.h>
  28.  
  29. main()
  30. {
  31. static char message[100];
  32. static struct timeval times;
  33.  
  34.  
  35. gettimeofday(×);
  36. cftime (message,"%C",(time_t *) ×.tv_sec);
  37. strcat (message,"testing message ");
  38. puts (message);
  39. }
  40.  
  41.  
  42.  
  43.  
  44. William Z. Tang
  45. tangb@tccs2.ssd.lmsc.lockheed.com
  46. B104       (408) 743-7098
  47.